using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Text.RegularExpressions;
using Castle.MonoRail.Framework;
using DotNet_Common;


namespace res.Controllers
{
    public class BookController : SmartDispatcherController
    {

        public void index()
        {
            
        }



        public void list()
        {
            DbExecuter db = new DbExecuter();

            string autosql = StrCommon.GetFormSql();

            string sql = "select * from res_book where 1=1" + autosql + " order by id desc";

            Pager p = new Pager(sql, 10, db);

            PropertyBag["data"] = p.Data.Rows;

            PropertyBag["pages"] = p.PageList();
        }


        public void info()
        {
            DbExecuter db = new DbExecuter();

            string sql = "select * from res_book where id=" + Query["id"];

            DataTable book = db.Exec(sql);

            PropertyBag["bookinfo"] = book.Rows[0];

        }

    }
}